export default{
    powerCounter(state){
        return state.counter * state.counter
    },
    //通过getter来操作数据
    selecetStudent(state){
        return state.students.filter(s=>s.age>17)
    },
    //可将getters作为参数传入
    getCounr(state,getters){
        return getters.selecetStudent.length
    },

    moreAgestu(state){
       /*  return function(age){
            return state.students.filter(s => s.age >age)
        } */

/*             //这样写阅读性太差了，不建议  
         return age=>state.students.filter(s => s.age >age)
*/        
        return age=>{
            return state.students.filter(s=>s.age>age)
        }
        }
}